package _5_Create._5_1_Factory._5_1_2_Singleton;

/**
 * 饿汉模式，类加载时就实例化自己
 * 构造器私有，类不能被继承
 * 优于懒汉，因为线程安全，快
 */
public class EagerSingleton {
    private static final EagerSingleton m_instance = new EagerSingleton();

    private EagerSingleton() {
    }

    public static EagerSingleton getInstance() {
        return m_instance;
    }
}
